/**
 * 
 */
package com.shsh.safemanage.model;

import java.util.Calendar;
import java.util.List;

import com.shsh.safemanage.util.Constants;
import com.shsh.safemanage.util.MessageUtil;

/**
 * 
 * 
 * @author user
 * 
 */
public abstract class AbstractAccident extends Problem {
	/**
	 * ID
	 */
	private Long id;

	/**
	 * 
	 */
	private Long facadeID;
	/**
	 *
	 */
	private Integer accidentTypeID;

	private String accidentType;
	/**
	 * 
	 */
	private Integer accidentStatus;

	/**
	 * 
	 */
	private Calendar accidentTime;
	/**
	 *
	 */
	private String accidentName;

	/**
	 *
	 */
	private String loss;

	/**
	 *
	 */
	private String overview;

	/**
	 *
	 */
	private String handle;

	/**
	 *
	 */
	private String reason;

	/**
	 *
	 */
	private String moral;

	/**
	 *
	 */
	private String casualty;

	/**
	 *
	 */
	private Integer seriousInjuryCount;

	/**
	 * 
	 */
	private Integer deathCount;
	/**
	 *
	 */
	private Long accidentWriteUserID;
	/**
	 *
	 */
	private Calendar accidentWriteTime;

	/**
	 * 
	 */
	private String duty;

	/**
	 *
	 */
	private String team;

	/**
	 *
	 */
	private String introspection;
	/**
	 *
	 */
	private String reviewDetail;

	/**
	 *
	 */
	private String reviewTeam;

	/**
	 *
	 */
	private Calendar reviewTime;

	/**
	 */
	private List<AccidentCasualty> casualtyList;

	/**
	 *
	 */
	private String sendbackMsg;

	public AbstractAccident() {

	}

	public AbstractAccident(Problem problem) {
		super(problem);
	}

	public Long getFacadeID() {
		return facadeID;
	}

	public void setFacadeID(Long facadeID) {
		this.facadeID = facadeID;
	}

	public Calendar getAccidentTime() {
		return accidentTime;
	}

	public void setAccidentTime(Calendar accidentTime) {
		this.accidentTime = accidentTime;
	}

	@Override
	public Long getId() {
		return id;
	}

	@Override
	public void setId(Long id) {
		this.id = id;
	}

	public String getAccidentType() {
		return accidentType;
	}

	public void setAccidentType(String accidentType) {
		this.accidentType = accidentType;
	}

	public Integer getAccidentTypeID() {
		return accidentTypeID;
	}

	public void setAccidentTypeID(Integer accidentTypeID) {
		this.accidentTypeID = accidentTypeID;
	}

	public Integer getAccidentStatus() {
		return accidentStatus == null ? Constants.ACCIDENT_STATUS_APPLICATION : accidentStatus;
	}

	public void setAccidentStatus(Integer accidentStatus) {
		this.accidentStatus = accidentStatus;
	}

	public String getAccidentName() {
		return accidentName;
	}

	public void setAccidentName(String accidentName) {
		this.accidentName = accidentName;
	}

	public String getLoss() {
		return loss;
	}

	public void setLoss(String loss) {
		this.loss = loss;
	}

	public String getOverview() {
		return overview;
	}

	public void setOverview(String overview) {
		this.overview = overview;
	}

	public String getHandle() {
		return handle;
	}

	public void setHandle(String handle) {
		this.handle = handle;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getMoral() {
		return moral;
	}

	public void setMoral(String moral) {
		this.moral = moral;
	}

	public String getCasualty() {
		return casualty;
	}

	public void setCasualty(String casualty) {
		this.casualty = casualty;
	}

	public Integer getSeriousInjuryCount() {
		return seriousInjuryCount;
	}

	public void setSeriousInjuryCount(Integer seriousInjuryCount) {
		this.seriousInjuryCount = seriousInjuryCount;
	}

	public Integer getDeathCount() {
		return deathCount;
	}

	public void setDeathCount(Integer deathCount) {
		this.deathCount = deathCount;
	}

	public Long getAccidentWriteUserID() {
		return accidentWriteUserID;
	}

	public void setAccidentWriteUserID(Long accidentWriteUserID) {
		this.accidentWriteUserID = accidentWriteUserID;
	}

	public Calendar getAccidentWriteTime() {
		return accidentWriteTime;
	}

	public void setAccidentWriteTime(Calendar accidentWriteTime) {
		this.accidentWriteTime = accidentWriteTime;
	}

	public String getDuty() {
		return duty;
	}

	public void setDuty(String duty) {
		this.duty = duty;
	}

	public String getTeam() {
		return team;
	}

	public void setTeam(String team) {
		this.team = team;
	}

	public String getIntrospection() {
		return introspection;
	}

	public void setIntrospection(String introspection) {
		this.introspection = introspection;
	}

	public String getReviewDetail() {
		return reviewDetail;
	}

	public void setReviewDetail(String reviewDetail) {
		this.reviewDetail = reviewDetail;
	}

	public String getReviewTeam() {
		return reviewTeam;
	}

	public void setReviewTeam(String reviewTeam) {
		this.reviewTeam = reviewTeam;
	}

	public Calendar getReviewTime() {
		return reviewTime;
	}

	public void setReviewTime(Calendar reviewTime) {
		this.reviewTime = reviewTime;
	}

	public List<AccidentCasualty> getCasualtyList() {
		return casualtyList;
	}

	public void setCasualtyList(List<AccidentCasualty> casualtyList) {
		this.casualtyList = casualtyList;
	}

	public String getSendbackMsg() {
		return sendbackMsg;
	}

	public void setSendbackMsg(String sendbackMsg) {
		this.sendbackMsg = sendbackMsg;
	}

	public String getAccidentStatusLabel() {
		if (accidentStatus == null) {
			accidentStatus = Constants.ACCIDENT_STATUS_APPLICATION;
		}

		switch (accidentStatus) {
		case Constants.ACCIDENT_STATUS_APPLICATION:
			return MessageUtil.getMessage(Constants.LABEL_KEY_ACCIDENT_STATUS_APPLICATION);
		case Constants.ACCIDENT_STATUS_UPDATE:
			return MessageUtil.getMessage(Constants.LABEL_KEY_ACCIDENT_STATUS_UPDATE);
		case Constants.ACCIDENT_STATUS_COMPLETE:
			return MessageUtil.getMessage(Constants.LABEL_KEY_ACCIDENT_STATUS_COMPLETE);
		default:
			return MessageUtil.getMessage(Constants.LABEL_KEY_ACCIDENT_STATUS_APPLICATION);
		}
	}

	public boolean statusMatches(int status) {
		return this.getAccidentStatus().intValue() == status;
	}
}
